<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<% out.write(String.valueOf(new java.util.Date()));%><br>
<hr>
<%
    int sum=0;
    for(int i=1;i<=100;i++){
        sum+=i;
    }
    out.println("<h1>"+sum+"<h1>");
    Test();
%>










<%!
    static {
        System.out.println("进入了自定义块");
    }
    private int global = 0;
    public void Test(){
        System.out.println("进入了方法Test");
    }
%>
</body>
</html>
